package com.coder.exercise;

 public class TreeNode {
     int val;
     TreeNode left;
     TreeNode right;
     TreeNode(int x) { 
    	 val = x; 
     }
     public static TreeNode getInstance(){
    	 TreeNode a = new TreeNode(1);
    	 TreeNode b = new TreeNode(2);
    	 TreeNode c = new TreeNode(3);
    	 TreeNode d = new TreeNode(4);
    	 TreeNode e = new TreeNode(5);
    	 TreeNode f = new TreeNode(6);
    	 TreeNode g = new TreeNode(7);
    	 TreeNode h = new TreeNode(8);
    	 d.left = h;
    	 b.left = d;
    	 b.right = e;
    	 c.left = f;
    	 c.right = g;
    	 a.left = b;
    	 a.right = c;
    	 
    	 return a;
     }
}